<?php
/**
 * 货币查询控制器
 */
namespace app\manage\controller\coin;
use app\manage\controller\Base;

class Api extends Base
{
	/**
	 * 查询货币类型
	 * @return [type] [description]
	 */
    public function coin_type(){
        
        $params = $this->request->only(['id']);
        $id = isset($params['id'])?$params['id']:null;

        $data = model('coin')::coinData($id);
        return json($data);

    }

    /**
     * 根据类型查询货币配置
     * @return [type] [description]
     */
    public function config_type(){
    	$params = $this->request->param();
    	if(isset($params['type'])):
            $data = model('coin_config')::coinConfigByType($params['type']);
            return json($data);
        endif;
    }

    /**
     * 根据id查询单条货币配置
     * @return [type] [description]
     */
    public function config_row(){
        $params = $this->request->param();
        $id = $params['id'];

        $data = model('coin_config')::coinConfigData($id);
        return json($data);

    }

}
